# encoding=utf-8
from sqlalchemy import Column, Integer, FetchedValue, Text, String
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()


class Log(Base):
    __tablename__ = 'logs'
    id = Column(Integer, primary_key=True)
    type = Column(Integer, nullable=False, server_default=FetchedValue())
    level = Column(Integer, nullable=False, server_default=FetchedValue())
    data = Column(Text, nullable=False)
    create_time = Column(Integer, nullable=False)


class PlayersModel(Base):
    __tablename__ = 'players'
    id = Column(Integer, primary_key=True)
    name = Column(String(20), nullable=False)


class TeamsModel(Base):
    __tablename__ = 'teams'
    id = Column(Integer, primary_key=True)
    name_en = Column(String(20), nullable=False)
    name_ch = Column(String(20), nullable=False)


class SeasonsModel(Base):
    __tablename__ = 'seasons'
    id = Column(Integer, primary_key=True)
    name = Column(String(20), nullable=False)
